<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SpongeBob</title>
    <style>
        body {
            font-family: 'Comic Sans MS', cursive, sans-serif;
            background-color: #f5ce42;
            color: #000;
            text-align: center;
            margin: 0;
            padding: 0;
            display: flex;  /* 使用 flexbox 布局 */
            flex-direction: column;  /* 子元素垂直排列 */
            min-height: 100vh;  /* 确保 body 最小高度为视窗高度 */
        }
        .header {
            background-color: #ff6600;
            padding: 20px;
            color: #fff;
            font-size: 2em;
        }
        .message-container {
            margin: 20px auto;
            width: 80%;
            background-color: #fff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            flex-grow: 1;  /* 让内容区域占据剩余空间 */
        }
        .message-container p {
            font-size: 1.5em;
            margin: 10px 0;
        }
        .footer {
            background-color: #ff6600;
            padding: 10px;
            color: #fff;
            font-size: 1em;
            flex-shrink: 0;  /* 防止 footer 缩小 */
        }
    </style>
</head>
<body>
    <div class="header">
        <h1><?= $heading ?></h1>
        <p><a href="/SpongeBob">let's go SpongeBob'world</a></p>
    </div>
    <div class="message-container">
        <?php foreach ($messages as $message): ?>
            <p><?= $message ?></p>
        <?php endforeach; ?>
    </div>
    <div class="footer">
        <p>Made with ❤️ by Xiezhaokai</p>
    </div>
</body>
</html>